package com.niiwoo.civet.trade.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.ArrayList;
import java.util.List;

/**
 * 散标投资排序
 * 
 * @author liuchun title 和sort 修改不影响业务 value值变更需要查询的时候对应修改
 */
@Getter
@AllArgsConstructor
public enum InvestFilterEnum {
//	BORROWER_TYPE("产品类型", "borrowerType", (byte) 0, 4),
	PRODUCT_TYPE("产品类型", "productType", (byte) 0, 0),
	PERIOD_CONFIG("期限", "periodConfig", (byte) 0, 1),
	REPAYMENT_TYPE("还款方式", "repaymentType", (byte) 0,2),
	RATE_CONFIG("参考年化利率", "rateConfig", (byte) 0,3),
	INVEST_AMOUNT("可投金额", "investAmount", (byte) 1, 4),
	DISCOUNT("是否优惠","favorableType",(byte)3,5);
//	TRANSFER_TYPE("是否可转让", "transferType", (byte) 0, 2),
// ORG("标的来源", "orgId", (byte) 0,5),

	/**
	 * 标题
	 */
	private String title;
	/**
	 * 参数key值,不允许修改 涉及到 筛选列表，查询列表的联动
	 */
	private String key;
	/**
	 * 列表类型,0:不区别,1:信用标，2:抵押标 3:转让区,
	 */
	private Byte investType;
	
	/**
	 * 排序
	 */
	private Integer sort;
	
	
	public static List<InvestFilterEnum> getEnumByInvestType(Byte type){
		List<InvestFilterEnum> enums = new ArrayList<>();
		Byte zore = Byte.valueOf("0");
		for (InvestFilterEnum investFilterEnum : InvestFilterEnum.values()) {
			if(zore.equals(investFilterEnum.getInvestType())||type.equals(investFilterEnum.getInvestType())) {
				enums.add(investFilterEnum);
			}
		}
		return enums;
	}
	
	
}
